MacGS-510 A port of Aladdin Ghostscript to the Macintosh Version 503 ‹ Oct 18th, 1997 Version 510 ‹ Dec 1st, 1997 Ghostscript by L. Peter Deutsch MacGS & Macintosh drivers by Jeff Schindall Copyright © 1988-1995, 1997 Aladdin Enterprises, Menlo Park, CA. All rights reserved. Very Quick Introduction to Ghostscript Ghostscript is a PostScript interpreter. PostScript is a language, not a graphic file format. A PostScript file is really a program, not graphical data. The difference is that by looking at a PostScript file you (or an application) cannot easily tell what the file represents. Instead, you must run the file to see what it does. Generally, the result of running a PostScript program is to draw marks on a graphical page. (There are PostScript programs that don't draw anything at all! Some are even distributed as test files with Ghostscript.) This works well for printers but is a bit odd for interactive window systems. Think of MacGS as a virtual printer: Every time you open a file, asking Ghostscript to run it as a PostScript program, the application creates a new sheet of 'paper' and displays it in a window. You can see the program execute as it places marks on the 'paper' in the window (unless your computer is much faster than mine!) Once the program is done, the page is 'ejected' from the printer. However, the application leaves the window on the screen so you can continue to look at it (and scroll it, save it, etc.). But remember, at this point, the page is out of the printer and Ghostscript can no longer change it. If you want to change some parameter (such as scaling), you must change the parameter and then re-open, and thus re-run, the PostScript file. Please see the file readme and the files that end in .txt in the doc folder for more information. Unpacking The release consists of the following files: macgs-510-files.sit ‹ Ghostscript files and documentation macgs-510-68k.sit ‹ the application compiled for 68020 or better macgs-510-ppc.sit ‹ the application compiled for PPC machines macgs-510-fat.sit ‹ the application compiled for both 68k and PPC machines macgs-510-fonts.sit ‹ the standard Ghostscript 5.xx fonts macgs-510-src.sit ‹ the source files These files are StuffIt archives. If you do not have a program to expand these, you should get the free StuffIt Expander program from your favorite Macintosh archive. For users who have limited memory, the following executables are provided: macgs-lite-510-68k.sit ‹ the application compiled for 68020 or better macgs-lite-510-ppc.sit ‹ the application compiled for PPC machines macgs-lite-510-fat.sit ‹ the application compiled for both 68k and PPC machines The "Lite" version of MacGS contains only the macintosh rendering device, and the pdfwriter device. [ 1 ] Unstuff macgs-510-files.sit. It will create a folder named Ghostscript on your disk. [ 2 ] Unstuff one of the two application files, macgs-510-68k.sit or macgs-510-ppc.sit into the Ghostscript folder. Remember to only unstuff one of them! The Finder gets confused if you have more than one version of an application on a disk. [ 3 ] Unstuff macgs-510-fonts.sit into the Ghostscript folder as well. This exactly the same collection of fonts as ghostscript-fonts-std-3.0.tar.gz, just in a format most Macintosh users can handle. You will only need macgs-510-src.sit if you are planning on compiling the program yourself. See the chapter "Building It" for more details. Starting Launch the application. By default, it will show you the Ghostscript console window, where you can see messages to and from Ghostscript. After a few seconds, all initialization will be done and you will see the ŒGS>Ή prompt in the console window. You donΉt actually have to wait for the prompt to begin using the program, anything that needs to wait for the prompt will do so automatically if you do it too early. Getting Help The program makes extensive use of Balloon Help. Turn it on and explore! Rendering a PostScript File Choosing 'Open' from the 'File' menu lets you choose any TEXT or EPSF file. When you open a file this way, a new window is created, it is presented to Ghostscript for interpretation. This (usually) results in rendering the first page of the file into the window. If there are more pages in the file, you will see a small alert box with two buttons: 'Next Page' and 'Interrupt'. Clicking the first will clear the window and let Ghostscript continue on with the next page in the file. Clicking the second asks Ghostscript to cancel processing the rest of the file. Once a file has been rendered, it stays on the screen. You can resize, scroll it, save it (as a PICT file), copy it (to the clipboard). You can have as many windows open as memory allows. Printing a PostScript File After opening a document, you may print it by choosing the command 'Print' from the 'File' menu. A "settings" dialog is presented for you to adjust the imaging options. Next, the standard print dialog appears and the user may set the page range or print the entire document. If a page range is selected, then the MacGS make take some time and consume a considerable amount of memory skipping to the pages to be printed. Settings You can change the settings of output media with the "Settings" dialog. Open this dialog by choosing "Settings..." from the "Edit" menu. There are three major sections: Page Size lets you set the size of the 'logical' page. This is the size that the PostScript file works with. Scaling lets you enlarge or reduce the 'logical' page to produce the actual output you see. This scaling happens conceptually after the page is printed. However, Ghostscript is aware of this final scaling and will adjust some parameters accordingly (such as halftone screen, or any other parameters that are in 'device coordinates'). Image Options let you select options that pertain to how the image is rendered and recorded. For example, if you want to render a document that was designed for a Letter size paper, but you want the output to be reduced to half size, then choose "US Letter" for the Page Size and "Half" for the Scaling. There are too many controls and options in this dialog to discuss here: Turn on balloon help and explore it! The options apply to all devices (see below), except Image Options which only apply to the 'mac' device. Using MacGS as a Web Helper Application You can use MacGS as a helper application for your web browser. The following steps show how to configure the Netscape browser. If you are using a different browser, the configuration will be similar: [ 1 ] In the Preferences section called Helper Applications, check to see if there is a Mime type application/postscript. If there isn't, then click New... and create one: In the dialog that appears, set the type to application, and the subtype to postscript, then click OK. [ 2 ] Select the application/postscript Mime type by clicking on it. [ 3 ] Set the extensions by typing ai,eps,ps into the Extensions field. [ 4 ] Set the application by clicking the Browse... button. In the dialog that appears, choose the MacGS application and click OK. Then choose the File type TEXT from the pop-up menu. [ 5 ] Set the action to Launch Application. [ 6 ] Click OK in the Preferences window to save the changes. Some browsers, though not Netscape, may need to be restarted before the change will take effect. IMPORTANT: Postscript includes operators for manipluating files. A buggy or malicious postscript file could damage the files on your harddisk. To minimize this risk, you should start MacGS and set the command line in the Preferences to: -dSAFER This disable a number of file operations in Ghostscript. Note that there are two problems with this: (a) This option does not claim to be fool proof - Postscript is very powerful and this option can't guard against all possible problems. (b) You will be unable to render to any of the file devices when this is set. However, you still be able to save what you render to the screen as PICT files. To turn off this feature, you need to remove -dSAFER from the command line in the Preferences dialog, then quit and restart MacGS. Rendering to a File Ghostscript supports a large number of graphic output formats. Ghostscript calls these devices. When your copy of the Macintosh port of Ghostscript was built, some devices were chosen to be included. Since there are over a hundred devices, generally not all were included. When you run the application, the devices that are included are listed in the 'Devices' menu. The first one is always 'mac', which is the device for rendering into a Macintosh window. To use another device, and cause Ghostscript to render into a graphic file, choose the device from the Device menu, and then open the file as normal. This time, instead of a new window appearing, you will be asked to named a file to hold the output. The settings dialog can be used to set the page size and scaling options. Note that the image options have no effect on other devices. To switch back to rendering into a window, just choose 'mac' from the 'Devices' menu. Stopping the Application You can attempt to interrupt Ghostscript from whatever it is doing with the key sequence (it is also available as 'Interrupt' in the 'Ghostscript' menu). Interrupting a PostScript program is inherently unpredictable. This is because a PostScript file can trap the user-interrupt and refuse to stop! Interrupt is implemented so that it should work smoothly in most cases, but you can't be sure. If it doesn't work, hit it a few more times. Similarly, Quit is also something that a PostScript program can refuse to do! Sometimes, Ghostscript may not appear not to quit. Always give it a few seconds to try. If it just won't quit, the work around is to type: